﻿package sangpil.utils.movieClip
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	import sangpil.utils.bitmap.GetBitmap;
	
	public class Isolation
	{
		public static function upDown(mc:MovieClip, posY:Number):Array
		{
			var sected:Array = [];
			var src:BitmapData = GetBitmap.getBitmap(mc, mc.width, mc.height);
			sected[0] = GetBitmap.getBitmapSection(src, 0, 0, mc.width, posY);
			sected[1] = GetBitmap.getBitmapSection(src, 0, posY, mc.width, mc.height-posY);
			
			var returnSprite:Array = [];
			trace('test');
 			returnSprite[0] = new Sprite();
			returnSprite[0].graphics.beginBitmapFill(sected[0]);
			returnSprite[0].graphics.drawRect(0,0,mc.width,posY);
			returnSprite[0].graphics.endFill();
			
			returnSprite[1] = new Sprite();
			returnSprite[1].graphics.beginBitmapFill(sected[1]);
			returnSprite[1].graphics.drawRect(0,0,mc.width,mc.height - posY);
			returnSprite[1].graphics.endFill(); 
			
			return returnSprite;
		}
		
		public function Isolation()
		{
		}

	}
}